// Copyright (c) 2023 Presto Labs Pte. Ltd.
// Author: qiang

#pragma once

#include "coin2/exchange/base/order/order.h"
#include "coin2/exchange/mercado/api_order/native_private_client.h"

namespace coin2::exchange::mercado::api_order {

class MercadoRestAsyncAsioSubscriber : public base::order::RestSubscriber {
 public:
  using RestParams = coin2::exchange::order::MercadoSpotRestParams;
  using RestClient = MercadoNativePrivateClient;

 public:
  using RestSubscriber::RestSubscriber;

  auto rest_client() { return dynamic_cast<RestClient*>(rest_client_); }
  void QueryAccountBalance();
  void QueryOrderList(const std::string& native_symbol, const std::string status,  const std::string side);
  void QueryToken();
  void SubscribeAsync() override;

private:
  bool TokenIsExpiration();
};

}  // namespace coin2::exchange::mercado::api_order
